import Vue from 'vue'
import App2 from './App2.vue'
import VueResource from 'vue-resource'
import VueRouter from 'vue-router'


//引入四个页面
import Home from './Home.vue'
import Explorer from './Explorer.vue'
import Cart from './Cart.vue'
import Me from './Me.vue'


Vue.use(VueRouter)
Vue.use(VueResource)

const router  = new VueRouter({
  linkActiveClass:"active",
  mode:'history',
  base:__dirname,
  routes:[
    //将页面组件与path指定的路由关联
    {path:'/',component:Home},
    {path:'/explorer',component:Explorer},
    {path:'/cart',component:Cart},
    {path:'/me',component:Me}
  ]
})
new Vue({
  el: '#app',
  router,
  render: h => h(App2),
  http:{
    root:'/',
    headers:{}
  }

})